package com.bishe.controller;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.bishe.pojo.UserBill;
import com.bishe.pojo.query.StatisticsQuery;
import com.bishe.pojo.query.UserBillQuery;
import com.bishe.pojo.response.Result;
import com.bishe.service.impl.StatisticsServiceImpl;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("tj")
@Api(tags = "统计控制器")
public class StatisticsController {

    @Resource
    private StatisticsServiceImpl statisticsService;


    @GetMapping("/findPayAndIncome")
    @ApiOperation("按年、月查所有类型收入 支出")
    public Result<?> findPayAndIncome(StatisticsQuery query) {
        return Result.ok(statisticsService.findPayAndIncome(query));
    }

    @GetMapping("/findTypeNumber")
    @ApiOperation("按月返回每个类型的数量")
    public Result<?> findTypeNumber(StatisticsQuery query) {
        return Result.ok(statisticsService.findTypeNumber(query));
    }

    @GetMapping("/nowYearData")
    @ApiOperation("当年十二个月的支出收入")
    public Result<?> nowYearData() {
        return Result.ok(statisticsService.nowYearData());
    }



}
